"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = Example;

var _react = _interopRequireWildcard(require("react"));

var _design = require("@discuzq/design");

function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }

function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }

function Example() {
  var popoverCloseRef = (0, _react.useRef)(null);
  return /*#__PURE__*/_react.default.createElement("div", {
    className: "popover-page"
  }, /*#__PURE__*/_react.default.createElement("div", {
    className: "popover-container--base"
  }, /*#__PURE__*/_react.default.createElement(_design.Popover, {
    placement: "TOP",
    needOutsideClose: false,
    content: /*#__PURE__*/_react.default.createElement("div", {
      style: {
        width: "150px"
      }
    }, "\u6D6E\u5C42\u5185\u5BB9\u4E0D\u9700\u8981\u7EC4\u4EF6\u5916\u5173\u95ED\uFF0C\u53EA\u5141\u8BB8\u89E6\u53D1\u5668\u5173\u95ED\u3002")
  }, /*#__PURE__*/_react.default.createElement(_design.Button, null, "\u7981\u6B62\u5916\u90E8\u5173\u95ED")), /*#__PURE__*/_react.default.createElement(_design.Popover, {
    placement: "TL",
    trigger: "click",
    closeCallback: function closeCallback(callback) {
      return popoverCloseRef.current = callback;
    },
    content: /*#__PURE__*/_react.default.createElement("div", {
      style: {
        width: "150px"
      }
    }, "\u6D6E\u5C42\u5185\u5BB9\u4E0D\u9700\u8981\u7EC4\u4EF6\u5916\u5173\u95ED\uFF0C\u53EA\u5141\u8BB8\u89E6\u53D1\u5668\u5173\u95ED", /*#__PURE__*/_react.default.createElement("div", {
      style: {
        color: "#C0C8FC",
        cursor: "pointer"
      },
      onClick: function onClick() {
        var _popoverCloseRef$curr;

        return (_popoverCloseRef$curr = popoverCloseRef.current) === null || _popoverCloseRef$curr === void 0 ? void 0 : _popoverCloseRef$curr.call(popoverCloseRef, false);
      }
    }, "close"))
  }, /*#__PURE__*/_react.default.createElement(_design.Button, null, "\u652F\u6301 content \u5185\u56DE\u8C03\u5173\u95ED"))));
}